<template>
  <div class="absolute" style="top:2vh;left: 50vw;">
<!--    <label for="file">导入表格</label>-->
    <input type="file" class="hidden" id="file" @change="importTable"/>
    <button class="cursor-pointer" @click="exportTable">导出表格到excel</button>
    <button @click="change">修改</button>
  </div>
</template>

<script>
/* 表格导入导出模块 */
import { exportExcel } from 'boot/excel'
import importFile from 'components/importExport/importFile'
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'index',
  setup () {
    const exportTable = () => { // 导出表格
      const luckyObj = luckysheet.getluckysheetfile() // 获取所有表格数据
      exportExcel(luckyObj)
    }
    const change = function () {
      // luckysheet.setCellValue(4, 2, 2)
      // console.log(sheet)
      // luckysheet.setSheetAdd({
      //   sheetObject: sheet,
      //   order: 2,
      //   success: function () {
      //     console.log('eee')
      //   }
      // })
    }
    const importTable = (e) => {
      const result = importFile(e)
      console.log(result)
    }
    return {
      exportTable,
      change,
      importTable
    }
  }
})
</script>

<style scoped>

</style>
